setTimeout(function () {
    al();
    noop();
    noal();


}, 200)

var url = "http://hengzhi.ayvvv.com";
var serCmsData = localStorage.getItem('token');
if (serCmsData == null) {
    window.location.href = "login.html";
}
//
function al() {
    var aaa = getUrlParam('orderDetail');
    var jjj = getUrlParam('ggg')
    console.log(aaa, "传过来的id")
    $('#speciala').attr('href', 'tijiaopingjia.html?newid=' + aaa+`&moreid=`+jjj)
    $.ajax({
        url: url + '/api/order/detail/' + aaa,
        dataType: 'json',
        type: 'get',
        async: true,
        headers: {
            "x-token": serCmsData
        },
        success: function (data) {
            if (data.status == 200) {

                var Arr = data.data;

                $('#checkoutAddrList dl').append(`
                        <dt>
                        <strong class="itemConsignee">` + Arr.real_name + `</strong>
                    </dt>
                    <dd>
                        <p class="tel itemTel">` + Arr.user_phone + `</p>
                        <p class="itemRegion">` + Arr.user_address + `</p>
                    </dd>
                  `);
                for (var i = 0; i < Arr.orderProduct.length; i++) {
                    $('#substance').append(`
                            <div class="item-row">
                            <div class="col col-1">
                                <div class="g-pic">
                                    <img src="` + Arr.orderProduct[i].cart_info.product.image + `"  width="40" height="40" />
                                </div>
                                <div class="g-info">
                                    <a href="#">
                                       ` + Arr.orderProduct[i].cart_info.product.store_name + ` </a>
                                    <a href="#" style="margin-left: 60px;">
                                        ` + Arr.order_sn + ` </a>
                                </div>
                            </div>
                            <div class="col col-2">` + Arr.orderProduct[i].cart_info.product.price + `</div>
                            <div class="col col-3">` + Arr.total_num + `</div>
                        </div>
                         `);
                }
                $('.checkout-price').append(`
                    <ul>
                    <li>
                        订单总额：<span>`+ Arr.total_price + `</span>
                    </li>
                </ul>
                <p class="checkout-total">应付总额：<span><strong id="totalPrice">`+ Arr.pay_price + `</strong>元</span>
                </p>
                 `);

            } else {
            }
        }
    });
}


function noal() {
    var bbb = getUrlParam('nop');
    $.ajax({
        url: url + '/api/order/group_order_detail/' + bbb,
        dataType: 'json',
        type: 'get',
        async: true,
        headers: {
            "x-token": serCmsData
        },
        success: function (data) {
            if (data.status == 200) {
                var Arr = data.data;
                $('#checkoutAddrList dl').append(`
                        <dt>
                        <strong class="itemConsignee">` + Arr.real_name + `</strong>
                    </dt>
                    <dd>
                        <p class="tel itemTel">` + Arr.user_phone + `</p>
                        <p class="itemRegion">` + Arr.user_address + `</p>
                    </dd>
                  `);
                for (var i = 0; i < Arr.orderList.length; i++) {
                    for (var j = 0; j < Arr.orderList[i].orderProduct.length; j++) {
                        $('#substance').append(`
                            <div class="item-row">
                            <div class="col col-1">
                                <div class="g-pic">
                                    <img src="` + Arr.orderList[i].orderProduct[j].cart_info.product.image + `"  width="40" height="40" />
                                </div>
                                <div class="g-info">
                                    <a href="#">
                                       ` + Arr.orderList[i].orderProduct[j].cart_info.product.store_name + ` </a>
                                    <a href="#" style="margin-left: 60px;">
                                        ` + Arr.group_order_sn + ` </a>
                                </div>
                            </div>
                            <div class="col col-2">` + Arr.orderList[i].orderProduct[j].cart_info.product.price + `</div>
                            <div class="col col-3">` + Arr.orderList[i].orderProduct[j].product_num + `</div>
                        </div>
                         `);
                    }
                }
                $('.checkout-price').append(`
                    <ul>
                    <li>
                        订单总额：<span>`+ Arr.total_price + `</span>
                    </li>
                </ul>
                <p class="checkout-total">应付总额：<span><strong id="totalPrice">`+ Arr.pay_price + `</strong>元</span>
                </p>
                 `);

                $('.checkout-confirm').append(`
                 <a href="order.html" class="btn btn-lineDakeLight btn-back-cart">返回订单列表</a>
                 <a class="btn btn-primary" href="../../qrcode/erweima.html?pay=`+ Arr.group_order_sn + `&payprice=` + Arr.pay_price + `">立即下单</a>
               
              `);


            } else {
            }
        }
    });
}



function noop() {
    var ccc = getUrlParam('noop');

    $.ajax({
        url: url + '/api/order/group_order_detail/' + ccc,
        dataType: 'json',
        type: 'get',
        async: true,
        headers: {
            "x-token": serCmsData
        },
        success: function (data) {

            if (data.status == 200) {
                var Arr = data.data;
                $('#checkoutAddrList dl').append(`
                        <dt>
                        <strong class="itemConsignee">` + Arr.real_name + `</strong>
                    </dt>
                    <dd>
                        <p class="tel itemTel">` + Arr.user_phone + `</p>
                        <p class="itemRegion">` + Arr.user_address + `</p>
                    </dd>
                  `);
                for (var i = 0; i < Arr.orderList.length; i++) {
                    for (var j = 0; j < Arr.orderList[i].orderProduct.length; j++) {
                        $('#substance').append(`
                            <div class="item-row">
                            <div class="col col-1">
                                <div class="g-pic">
                                    <img src="` + Arr.orderList[i].orderProduct[j].cart_info.product.image + `"  width="40" height="40" />
                                </div>
                                <div class="g-info">
                                    <a href="#">
                                       ` + Arr.orderList[i].orderProduct[j].cart_info.product.store_name + ` </a>
                                    <a href="#" style="margin-left: 60px;">
                                        ` + Arr.group_order_sn + ` </a>
                                </div>
                            </div>
                            <div class="col col-2">` + Arr.orderList[i].orderProduct[j].cart_info.product.price + `</div>
                            <div class="col col-3">` + Arr.orderList[i].orderProduct[j].product_num + `</div>
                        </div>
                         `);
                    }
                }
                $('.checkout-price').append(`
                    <ul>
                    <li>
                        订单总额：<span>`+ Arr.total_price + `</span>
                    </li>
                </ul>
                <p class="checkout-total">应付总额：<span><strong id="totalPrice">`+ Arr.pay_price + `</strong>元</span>
                </p>
                 `);

                $('.checkout-confirm').append(`
                 <a href="order.html" class="btn btn-lineDakeLight btn-back-cart">返回订单列表111</a>
                 <a class="btn btn-primary" href="../../qrcode/erweima.html?pay=`+ Arr.group_order_sn + `&payprice=` + Arr.pay_price + `">立即下单</a>
              `);
            } else {
            }
        }
    });
}